package com.trsj.lnsj.util.ui;
/**  

* <p>Title: DateToLongSerializer.java</p>  

* <p>Description: </p>  

* <p>Copyright: Copyright (c) 2018</p>  

* <p>Company: 七色环</p>  

* @author longky  

* @date 2018年9月14日  

* @version 1.0  

*/

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.util.Date;
 
public class DateToLongStringSerializer extends JsonSerializer<Date> {
    @Override
    public void serialize(Date date, JsonGenerator jsonGenerator,
                SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeString(String.valueOf(date.getTime()/1000));
    }
}

